import Cocoa
import FlutterMacOS

@main
class AppDelegate: FlutterAppDelegate {
  override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
    return true
  }

  override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
    return true
  }
  
  // 启用标准编辑菜单功能（复制、粘贴、剪切等）
  override func applicationDidFinishLaunching(_ notification: Notification) {
    super.applicationDidFinishLaunching(notification)
    
    // 确保应用响应标准编辑命令
    if let window = mainFlutterWindow {
      window.makeFirstResponder(window.contentViewController?.view)
    }
  }
}
